The present invention relates to an elementary function arithmetic unit, and particularly to a binary element function arithmetic unit adapted for finding at high speeds the values of elementary functions while maintaining good precision.
The Cordic method, which is one of the conventional methods of finding elementary functions, is equivalent to an algorithm for finding elementary functions by successively rotating the coordinate vectors, as described in "A Unified Algorithm for Elementary Functions," Vol. 38, 1971, SJCC, pp. 397-385.
The successive iterative equation (1.1) therefor is given as follows: ##EQU1##
where X.sub.i and Y.sub.i denote values along the X-axis and Y-axis of a vector on an XY coordinate system, Z.sub.i denotes the cumulative rotational angle (.alpha..sub.i) of the vector by the successive iteration of the vector, and .delta..sub.i denotes a given variation.
Here, m denotes a parameter which assumes the two values of m=1, m=-1, depending upon whether the elementary function to be found is a trigonometric function (inclusive of inverse trigonometric functions) or a hyperbolic function (inclusive of inverse hyperbolic functions). Further, P denotes the polarity for converging Y.sub.i or Z.sub.i into zero, which assumes two values, i.e., P=.+-.1, in each iterative step.
Here, if the polarity P is so controlled that Z.sub.i+1 becomes zero, and if the value of X.sub.i+1, Y.sub.i+1 and Z.sub.i+1 obtained by n iterations are denoted by X.sub.n, Y.sub.n and Z.sub.n, then there are obtained the results of the following equation (1.2), ##EQU2## where K.sub.1 denotes a constant determined by the number n of iterations and .delta..sub.i, and is given by ##EQU3##
Next, the polarity P is so controlled that Y.sub.i+1 becomes zero, and the iteration is effected n times to obtain the results as given by the following equation (1.3), ##EQU4##
As represented by the equations (1.2) and (1.3), therefore, if X.sub.0, Y.sub.0 and Z.sub.0 which are initial values of X.sub.i, Y.sub.i and Z.sub.i, are suitably selected (e.g., when cos (.sqroot.m w) is to be found, the values are so selected that X.sub.0 =1/K.sub.1, Y.sub.0 =0, Z.sub.0 =w in the equation (1.2)), the value can be found in any one of X.sub.n, Y.sub.n or Z.sub.n. The foregoing describes the fundamental algorithm of the Cordic method.
In constituting hardware with a binary arithmetic unit according to the Cordic method, .delta..sub.i =2.sup.-j (j: positive integer) is quoted, and the hardware is realized by barrel-shifting the multiplications Y.sub.i .multidot..delta..sub.i and X.sub.i .multidot..delta..sub.i in the step of successively iterating equation (1.1). Here, the rotational angle (.alpha..sub.i) utilizes the data stored in the memory (ROM) for each iteration. Therefore, the elementary function arithmetic unit had heretofore been constituted by a register, adder-subtracter, barrel shifter and memory.
FIG. 2 illustrates a conventional elementary function arithmetic unit which gives three initial values (a.sub.0, b.sub.0, c.sub.0). The initial values a.sub.0 and b.sub.0 may be input in a form opposite to those shown in FIG. 2; i.e., b.sub.0 may be input to the arithmetic unit 100 and a.sub.0 may be input to the arithmetic unit 101. One of the three initial values is an argument (in the case of cos (w), the argument stands for w) of an elementary function to be found, and the other two initial values are constants that should be determined depending upon the elementary functions to be found. The three initial values are subjected to the successive iterative operation n times by the arithmetic units 100, 101 and 102 in compliance with relationships a.sub.i+1 =a.sub.i .+-.b.sub.i .multidot..delta..sub.i, b.sub.i+1 =b.sub.i .+-.a.sub.i .multidot..delta..sub.i, and c.sub.i+1 =c.sub.i .+-.cR.sub.i. Here, .delta..sub.i denotes a given variation. cR.sub.i denotes a constant determined depending upon the number of iterations and which is stored in advance in the memory 103.
In the step of iteration, the value b.sub.i or c.sub.i is input to a controller 104 which in response to a control signal a controls whether the i+1-th operation of the arithmetic unit be an addition or a subtraction depending upon an elementary function to be found. After n times of iteration, any one of the output a.sub.n, b.sub.n or c.sub.n is selected by a multiplexer 105 that is controlled by a controller control signal b depending upon the elementary function to be found, and whereby an output d.sub.n is obtained. The output d.sub.n is equal to the output a.sub.n when the position 1 of the multiplexer 105 is selected, the output d.sub.n is equal to the output b.sub.n when the position 2 is selected, and the output d.sub.n is equal to the output c.sub.n when the position 3 is selected. The elementary function value is obtained for the output d.sub.n.
When a binary elementary function arithmetic unit is constituted by the above conventional Cordic method, a function 2.sup.-j is used for .delta..sub.i and the multiplications X.sub.i .multidot..delta..sub.i and Y.sub.i .multidot..delta..sub.i in the equation (1.1) are realized by a barrel shifter. Therefore, the maximum effective number of iterations is equal to the number of bits of the register. Iterations greater than this number give no meaning since the multiplication terms are all carried down relative to the adder terms of one side.
To obtain the value of an elementary function with a high precision, on the other hand, the value Z.sub.i or Y.sub.i must be sufficiently converged close to zero. To obtain maximum precision with the binary elementary function arithmetic unit based upon the Cordic method, therefore, the iterations must be done a number of times equal to the number of bits of the register. When the number of iterations is small, the value Z.sub.i or Y.sub.i does not converge sufficiently, and error is contained in the value of the elementary function that is found. Therefore, the precision is improved by increasing the number of iterations. In other words, the speed of operation for the elementary function becomes slow and, more than that, a memory having an increased capacity must be employed to store the data .alpha..sub.i of the equation (1.1) in an amount that meets the number of iterations. That is, with the conventional art, the speed of operating the elementary function and the memory capacity established a relationship in reverse proportion to the precision, and it was a serious problem to make them compatible with each other.